<?php
namespace app\setting\validate;
use think\Validate;
class User extends Validate{
    protected $rule = [
        "username"=> "require|max:20",
        "password"=> "require|max:20|unique:user",
        "email"=> "email",
        "account"=> "require|max:20",
    ] ;

    protected $message = [
        "username.require"=> "名称不能为空",
        "username.max"=> "名称最多不超过20个字符",
        "password.require"=> "密码不能为空",
        "password.max"=> "密码最多不超过20个字符",
        "account.require"=> "账号不能为空",
        "account.max"=> "账号最多不超过20个字符",
        "account.unique"=> "账号已经存在",
    ] ;

    public function sceneS()
    {
        return $this->only(['username', 'password', 'account']);
        	// ->append('name', 'min:5')
            // ->remove('age', 'between')
            // ->append('age', 'require|max:100');
    } 
}